package com.slg.android.manyanime.bean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Thinkpad on 2015/3/11.
 */
public class CartoonBean {
//    {
//        "id": "100000001",
//            "name": "尸兄",
//            "update_time": "1425983408",
//            "lastup": "130话",
//            "isOver": "0",
//            "cover": "http://shp.qpic.cn/manhua_cover/0/21_17_29_35e997edcb17f23221abf0154cfe40e8.jpg/0",
//            "artist": "七度魚",
//            "intro": "即将毁灭的世界......每周五更新...",
//            "ios_delete": "1",
//            "area": "内地",
//            "category": "故事 恐怖",
//            "score": "4.5"
//    },


    //    {
//        "name": "东京食尸鬼RE",
//            "pic": "http://manhua.tmcdn.net/upload/14210564823",
//            "id": "100032473",
//            "lastup": "更新至15话",
//            "update_time": "1422931280",
//            "tips_time": "",
//            "tips_content": "",
//            "is_new": "1",
//            "is_ad": "0"
//    },
    private String cartName;

    private String pic;

    private String id;

    private String lastup;

    private long update_time;

    private String tips_time;

    private String tips_content;

    private int isNew;

    private int isAd;

    public void parseJson(JSONObject jsonObject) {

        try {
            cartName = jsonObject.getString("name");

            pic = jsonObject.getString("pic");

            id = jsonObject.getString("id");

            lastup = jsonObject.getString("lastup");

            update_time = jsonObject.getLong("update_time");

            tips_content = jsonObject.optString("");

            tips_content = jsonObject.optString("");

            isNew = jsonObject.getInt("is_new");

            isAd = jsonObject.getInt("is_ad");


        } catch (JSONException e) {
            e.printStackTrace();
        }


    }




    public String getCartName() {
        return cartName;
    }

    public void setCartName(String cartName) {
        this.cartName = cartName;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getLastup() {
        return lastup;
    }

    public void setLastup(String lastup) {
        this.lastup = lastup;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(long update_time) {
        this.update_time = update_time;
    }

    public String getTips_time() {
        return tips_time;
    }

    public void setTips_time(String tips_time) {
        this.tips_time = tips_time;
    }

    public String getTips_content() {
        return tips_content;
    }

    public void setTips_content(String tips_content) {
        this.tips_content = tips_content;
    }

    public int getIsNew() {
        return isNew;
    }

    public void setIsNew(int isNew) {
        this.isNew = isNew;
    }

    public int getIsAd() {
        return isAd;
    }

    public void setIsAd(int isAd) {
        this.isAd = isAd;
    }

    @Override
    public boolean equals(Object o) {

        if (o instanceof CartoonBean) {
            CartoonBean bean = (CartoonBean) o;
            if (bean.getId().equals(this.id)) {
                return true;
            }
        }
        return false;
    }


}
